<template>
  <el-container style="height: 100vh; ">
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-menu router unique-opened :default-active="$route.path">
        <el-row justify="center" class="row-bg">
          <el-col :span="24" style="background-color: #409eff">
            <el-tag id="manageList" effect="dark">
              <i class="el-icon-menu"></i>&nbsp;&nbsp;管理列表
            </el-tag>
          </el-col>
        </el-row>

        <!-- 用户管理 -->
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-user"></i>用户管理 
          </template>
          <el-menu-item-group>
            <el-menu-item index="/userin/list">用户列表</el-menu-item>
            <el-menu-item index="/userin/edit">新建用户</el-menu-item>
          </el-menu-item-group>
        </el-submenu>

        <!-- 缴费管理 -->
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-money"></i>缴费管理
          </template>
          <el-menu-item-group>
            <el-menu-item index="/user/money/list">缴费信息</el-menu-item>
            <el-menu-item index="/user/money/edit">新建缴费</el-menu-item>
            <el-menu-item index="/money">小区金额管理</el-menu-item>
          </el-menu-item-group>
        </el-submenu>

        <!-- 管理员管理-->
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-help"></i>管理员管理
          </template>
          <el-menu-item-group>
            <el-menu-item index="/admin/list">管理员列表</el-menu-item>
            <el-menu-item index="/admin/edit">新建管理员</el-menu-item>
          </el-menu-item-group>
        </el-submenu>

        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-star-off"></i>其余管理
          </template>
          <el-menu-item-group>
            <el-menu-item index="/admin/floor">楼号管理</el-menu-item>
            <el-menu-item index="/admin/cell">小区管理</el-menu-item>
            <el-menu-item index="/admin/type">权限管理</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; ">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 5px;font-size: 17px;">
            <span style="cursor:pointer; font-size: 16px;margin-right: 15px">设置</span>
          </i>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>
              <span @click=" $router.push('/login')">退出登陆</span>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <span>{{username}}</span>
      </el-header>

      <el-main>
        <router-view class="pa" :key="$route.path"></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

 
<script>
export default {
  data() {
    return {
      username: null
    }
  },
  mounted() {
    this.fetchUsername()
  },
  methods: {
    fetchUsername(){
      this.username = sessionStorage.username;
    }
  },
};
</script>

 
<style>
html.body {
  margin: 0 !important;
  padding: 0;
}
.el-main {
  z-index: 1;
  overflow: hidden;
}

.pa {
  background-color: #ffffff;
}
#manageList {
  height: 60px;
  padding-left: 20px;
  line-height: 60px;
  font-size: 16px;
  width: 100%;
  font-weight: 200;
}
.el-header {
  padding-right: 40px !important;
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}
.el-main {
  height: 100%;
}
.el-card__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
}
.el-aside {
  color: #333;
}
</style>
